#coding=utf-8
import orm

MEETING_DB='qcb_ol'

@orm.build_model
class MeetingList(orm.Model):
    _table = "meeting_list"
    _conn_name = MEETING_DB
    _name = "会议列表"
    id = orm.IntegerType(name="id",length=11,primary_key=True,auto_increase=True,unsigned=True,comment='主键')
    type = orm.CharType(name="type",length=11,comment="类型")
    meeting_name = orm.CharType(name="meeting_name",length=30,comment="会议名称")
    meeting_status = orm.IntegerType(name="meeting_status",length=1,comment="会议状态",unsigned=True,blank=0)
    creator_id = orm.IntegerType(name="creator_id",length=11,comment="创建者id",unsigned=True)
    is_checked=orm.IntegerType(name="is_checked",length=1,comment="通过审核",unsigned=True,blank=0)
    creat_identity_id = orm.IntegerType(name="creat_identity_id",comment="创建者身份id",unsigned=True,blank=0,length=11)
    cover = orm.CharType(name="cover",length=255,varchar=True,comment="封面")
    meeting_address = orm.CharType(name="meeting_address",length=255,varchar=True,comment="会议地址")
    meeting_time = orm.DatetimeType(name="meeting_time",comment="会议时间")
    region = orm.CharType(name="region",comment="地区",length=20,varchar=True)
    short_summary = orm.CharType(name='short_summary',comment="短介绍",length=255,varchar=True)
    long_summary = orm.CharType(name="long_summary",comment="长介绍",length=5000,varchar=True)
    key_creator_id_index = orm.Key(key_name="key_creator_id_index",col_name="creator_id")


@orm.build_model
class MeetingDetail(orm.Model):
    _table = "meeting_detail"
    _conn_name = MEETING_DB
    _name = "会议详情"
    id = orm.IntegerType(name="id",length=11,primary_key=True,auto_increase=True,comment="主键",unsigned=True)
    meeting_id = orm.IntegerType(name="meeting_id",length=11,unsigned=True,comment="会议id")
    time = orm.CharType(name="time",length=15,comment="时间")
    content = orm.CharType(name="content",comment="主题",length=5000,varchar=True)


@orm.build_model
class MeetingManager(orm.Model):
    _table = "meeting_manager"
    _conn_name = MEETING_DB
    _name = "会议发布人"
    id = orm.IntegerType(name="id",length=11,primary_key=True,auto_increase=True,comment="主键",unsigned=True)
    user_id = orm.IntegerType(name="user_id",length=11,unsigned=True,comment="用户id",blank=0)
    invitation_code = orm.CharType(name="invitation_code",comment="邀请码",length=30,blank=False)
    contact_name = orm.CharType(name="contact_name",length=8,comment="联系人姓名",blank=False)
    contact_phone = orm.CharType(name="contact_phone",comment="联系电话",length=11,blank=False)
    contact_org = orm.CharType(name="contact_org",comment="发布机构",length=255,blank=False)
    key_invitation_code_index = orm.UniqueKey(key_name="key_invitation_code_index",col_name="invitation_code")
    key_user_id_index = orm.Key(key_name="key_user_id_index",col_name="user_id")


@orm.build_model
class MeetingReg(orm.Model):
    _table="meeting_reg"
    _name="会议报名详情"
    _conn_name = MEETING_DB
    id=orm.IntegerType(name="id",comment="主键",auto_increase=True,unsigned=True,primary_key=True,length=15)
    user_id=orm.IntegerType(name="user_id",comment="用户id",length=11,unsigned=True)
    name=orm.CharType(name="name",comment="名字",length=30,varchar=True)
    sex=orm.CharType(name="sex",comment="性别",length=2)
    id_card=orm.CharType(name="id_card",comment="身份证号",length=20)
    phone=orm.CharType(name="phone",comment="电话号码",length=11)
    company=orm.CharType(name="company",comment="公司",length=50,varchar=True)
    status=orm.IntegerType(name="status",comment="报名状态",length=2,unsigned=True,blank=0)
    user_type=orm.IntegerType(name='user_type',comment="用户类型id",unsigned=True,length=2)
    meeting_id=orm.IntegerType(name="meeting_id",comment="会议id",unsigned=True,length=11)
    organization = orm.CharType(name="organization",comment="组织",varchar=True,length=100)
    position=orm.CharType(name="position",comment="职位",varchar=True,length=30)
    email=orm.CharType(name="email",comment="邮箱地址",varchar=True,length=50)
    created_at = orm.DatetimeType(name="created_at",auto="on_create")
    updated_at=orm.DatetimeType(name="updated_at",auto="on_update")
    ukey_user_meeting_index = orm.UniqueKey(key_name="ukey_user_meeting_index",col_name=['user_id','meeting_id'])
    key_meeting_id_index = orm.Key(key_name="key_meeting_id_index",col_name="meeting_id")


@orm.build_model
class MeetingRegUserType(orm.Model):
    _table = 'meeting_reg_user_type'
    _name = "会议报名类型"
    _conn_name = MEETING_DB
    id=orm.IntegerType(name="id",comment="主键",length=2,auto_increase=True,unsigned=True)
    description = orm.CharType(name="description",comment="描述",length=5)



